Add comprehensive unit tests for models, services, and config (179 tests)#2
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
Add comprehensive unit tests for models, services, and config (179 tests)#2devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… school_config 179 tests covering: - JsonUtils (readString, readInt, readBool, readStringList, readStringMap) - ApiResponse parsing with multiple key formats - All model fromJson/toJson: MeritDemeritRecord, AbsenceRecord, AttendanceStatistics, CourseSchedule, CourseInfo, SubjectGrade, SemesterGrade, TotalScore, DailyPerformance, GradeData, ExamMenuItem, ExamSubjectScore, ExamSummary, StudentInfo, TimetableEntry, TimetableData, SubjectAbsence, NoticeItem, VocPassUser, VocPassPublicUser, Restaurant, RestaurantEvaluation, RestaurantMenu, PeriodTime, CourseExtra - ForumUser, ForumPost, ForumMessage, ForumPostListData, ForumMessageListData, ForumAdminInfo - W2MUserInfo, W2MEventSummary, W2MEventListResponse, W2MEvent, W2MUserAvailability, W2MSlot, w2mDisplayTimes, w2mShortDate - HtmlParser.parseExamScores with HTML entity decoding - SchoolConfig, LoginConfig, UrlConfig, RouteConfig, NoticeConfig, FieldConfig, ButtonConfig, CaptchaImageConfig Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The repo had zero test coverage — no
test/directory existed. This PR adds 179 unit tests across 5 test files covering the most testable (pure logic) modules:test/models_test.dartJsonUtils(all 6 methods with type coercion, fallback keys, defaults),ApiResponse.fromJson(standard/alt keys, success bool, non-map input), all modelfromJson/toJsonroundtrips:MeritDemeritRecord,AbsenceRecord,AttendanceStatistics,AttendanceTotals,CourseSchedule,CourseInfo,SemesterGrade,SubjectGrade,TotalScore,DailyPerformance,GradeData,ExamMenuItem,ExamSubjectScore,ExamSummary,StudentInfo,TimetableEntry,TimetableData,SubjectAbsence,NoticeItem,VocPassUser,VocPassPublicUser,Restaurant,RestaurantEvaluation,RestaurantMenu,PeriodTime,CourseExtratest/forum_models_test.dartForumUser,ForumPost(tag parsing/sorting,likeTargetID,imageURLs,isLikedBy),ForumMessage,ForumPostListData,ForumMessageListData,ForumAdminInfotest/w2m_models_test.dartW2MUserInfo,W2MEventSummary,W2MEventListResponse,W2MEvent(dates,slotCount,usersAvailable,maxCount),W2MUserAvailability,W2MSlot(equality/hashCode),w2mDisplayTimes(),w2mShortDate()test/html_parser_test.dartHtmlParser.parseExamScores— student ID extraction, exam info, table row parsing, HTML entity decoding (&,A,B, ,<, etc.), nested tag strippingtest/school_config_test.dartSchoolConfig(fromJson/fromApi/toJson/fromJsonStringroundtrips,isGuest,loginUrl,loginedUrl),LoginConfig(captcha image parsing, success keywords from list/string),UrlConfig,RouteConfig,NoticeConfig,FieldConfig,ButtonConfig,CaptchaImageConfigAll tests verify both the primary JSON keys and alternative/fallback keys that the models support.
Link to Devin session: https://app.devin.ai/sessions/a1315cec34014a0aadbe8cb129e3372c
Requested by: @HansHans135